<template>
  <div class="home">
    <img alt="Vue logo" src="../assets/logo.png">
    <HelloWorld msg="Welcome to Your Vue.js App"/>
    <h1>
      <router-link to="/"> INDEX </router-link>
    </h1>
    <button @click="replace"> replace </button>
    <button @click="goAbout"> go</button>
  </div>
</template>

<script>
// @ is an alias to /src
import HelloWorld from '@/components/HelloWorld.vue'

export default {
  name: 'Home',
  components: {
    HelloWorld
  },
  methods: {
    replace () {
      this.$router.replace('/About/21')
    },
    goAbout () {
      this.$router.push({ name: 'About', params: { name: '1' } })
    }
  }
}
</script>
